#!/usr/bin/python3
# _*_ coding: utf-8 _*_
#
# Copyright (C) 2024 - 2024 heihieyouheihei, Inc. All Rights Reserved 
#
# @Time    : 2024/8/7 23:11
# @Author  : Yuyun
# @File    : 字符串去重操作.py
# @IDE     : PyCharm

S = input().strip()
s = ''

#方法①——原始遍历拼接
for x in S:
    if x not in s:
        s += x
print(s)

#方法②——索引遍历拼接
for i in range(len(S)):
    if S[i] not in s:
        s += S[i]
print(s)

#方法③——集合去重、转为List后排序，再拼接
s_s = set(S)        #集合无序，去重时原字符顺序可能被变化
l_s = list(s_s)
l_s.sort(key = S.index)     #按照原字符串中字符索引排序
print(''.join(l_s))
